You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ha...@hyperreal.com> on 1995/12/09 03:55:18 UTC

KILL_IP_OPTIONS Patch! (fwd)

I'm too tired. Can someone with a working brain have a look at this

no ack sent.


Forwarded message:
> From neal@ctd.comsat.com  Fri Dec  8 10:03:10 1995
> Message-Id: <m0...@neal.ctd.comsat.com>
> Date: Fri, 8 Dec 95 13:03:05 -0500 (EST)
> From: neal@ctd.comsat.com (Neal Becker)
> To: apache-bugs@apache.org
> Subject: KILL_IP_OPTIONS Patch!
> X-Face: "$ryF/ne$oms9n}#TY|W5Ttjbp-6/u4j'7c:%-aq2IAf'&DjuvII4wvr:eU{h=GMPcVTP,p
>  XgCPnk{Qu:7P=jH00Q?B(*bZ\7#x_&KD=%hU1VhP'`hy'PF01*tU9DAoK7QXTGzL%fe!lIj,0Ds,P:
>  GV_YPd*4GO?ClJAPRa=iB\PuIQmM=Q>qo87lJh-N2PQL-2QaM>}LdWI<}
> Mime-Version: 1.0 (generated by tm-edit 1.1.1.1)
> Content-Type: text/plain; charset=US-ASCII
> 
> Please add an option to kill IP OPTIONS, at least to turn off source
> routing.  Here is a proposed untested patch.  What do you think of it?
> 
> *** http_main.c	1995/12/08 17:28:48	1.1
> --- http_main.c	1995/12/08 17:57:14
> ***************
> *** 806,811 ****
> --- 806,840 ----
>   
>   	current_conn = new_connection (ptrans, server_conf, conn_in, conn_out);
>   
> + #ifdef KILL_IP_OPTIONS
> + 	{
> + 	  struct protoent *ip;
> + 	  int ipproto;
> + 	  unsigned char optbuf[BUFSIZ / 3], *cp;
> + 	  char    lbuf[BUFSIZ], l2buf[BUFSIZ], *lp;
> + 	  int     optsize = sizeof(optbuf);
> + 
> + 	  if ((ip = getprotobyname("ip")) != 0)
> + 	    ipproto = ip->p_proto;
> + 	  else
> + 	    ipproto = IPPROTO_IP;
> + 
> + 	  if (getsockopt(csd, ipproto, IP_OPTIONS, (char *) optbuf, &optsize) == 0
> + 	      && optsize != 0) {
> + 	    lp = lbuf;
> + 	    for (cp = optbuf; optsize > 0; cp++, optsize--, lp += 3)
> + 	      sprintf(lp, " %2.2x", *cp);
> + 	    sprintf (l2buf, "connect from %s with IP options (ignored):%s",
> + 		     current_conn->remote_name, lbuf);
> + 	    log_error (l2buf, server_conf); /* is this correct? */
> + 	    if (setsockopt(csd, ipproto, IP_OPTIONS, (char *) 0, optsize) != 0) {
> + 	      log_error ("setsockopt IP_OPTIONS NULL", server_conf);
> + 	      continue;
> + 	    }
> + 	  }
> + 	}
> + #endif /* KILL_IP_OPTIONS */
> + 
>   	if (current_conn->server->do_rfc931)
>   	    current_conn->remote_logname = 
>   		rfc931((struct sockaddr_in *)&sa_client, &sa_server);
>