lkml.org 
[lkml]   [2000]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH] alignment issue with ipchains
Date
David S. Miller wrote:
> Could you send me a patch which fixes the problem in this way?

Sure. Here is the one. The occurrence of the IP_XXX corresponds the
one in switch/case.

Thank you for your time,

--- linux-2.4.0-test8-pre6/net/ipv4/ip_sockglue.c Fri Aug 11 05:01:26 2000
+++ linux/net/ipv4/ip_sockglue.c Sat Sep 9 14:42:25 2000
@@ -380,15 +380,22 @@ int ip_setsockopt(struct sock *sk, int l
{
int val=0,err;

- if(optlen>=sizeof(int)) {
- if(get_user(val, (int *) optval))
- return -EFAULT;
- } else if(optlen>=sizeof(char)) {
- unsigned char ucval;
- if(get_user(ucval, (unsigned char *) optval))
- return -EFAULT;
- val = (int)ucval;
- }
+ if (optname == IP_PKTINFO || optname == IP_RECVTTL
+ || optname == IP_RECVTOS || optname == IP_RECVOPTS
+ || optname == IP_RETOPTS || optname == IP_TOS
+ || optname == IP_TTL || optname == IP_HDRINCL
+ || optname == IP_MTU_DISCOVER || optname == IP_RECVERR
+ || optname == IP_MULTICAST_TTL || optname == IP_MULTICAST_LOOP
+ || optname == IP_ROUTER_ALERT)
+ if(optlen>=sizeof(int)) {
+ if(get_user(val, (int *) optval))
+ return -EFAULT;
+ } else if(optlen>=sizeof(char)) {
+ unsigned char ucval;
+ if(get_user(ucval, (unsigned char *) optval))
+ return -EFAULT;
+ val = (int)ucval;
+ }
/* If optlen==0, it is equivalent to val == 0 */

if(level!=SOL_IP)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.062 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site