summaryrefslogtreecommitdiff
path: root/debian/patches/patch.IP_SRCROUTE
blob: 84b7ee80128d34fda8bacdc3810bb42e3c1070fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
*** ../../src/conf.h	Mon Apr 12 15:12:30 1999
--- conf.h	Thu Apr  8 15:35:20 1999
***************
*** 1284,1290 ****
  # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
  # define GIDSET_T	gid_t	/* from <linux/types.h> */
  # define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
! # define IP_SRCROUTE	0	/* linux <= 1.2.8 doesn't support IP_OPTIONS */
  # define USE_SIGLONGJMP	1	/* sigsetjmp needed for signal handling */
  # ifndef HASFLOCK
  #  include <linux/version.h>
--- 1284,1290 ----
  # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
  # define GIDSET_T	gid_t	/* from <linux/types.h> */
  # define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
! # define IP_SRCROUTE	1	/* linux <= 1.2.8 doesn't support IP_OPTIONS */
  # define USE_SIGLONGJMP	1	/* sigsetjmp needed for signal handling */
  # ifndef HASFLOCK
  #  include <linux/version.h>
*** ../../src/daemon.c	Mon Apr 12 15:12:30 1999
--- daemon.c	Mon Apr 12 15:37:50 1999
***************
*** 42,48 ****
  # if IP_SRCROUTE
  #  include <netinet/in_systm.h>
  #  include <netinet/ip.h>
! #  include <netinet/ip_var.h>
  # endif
  
  /*
--- 42,50 ----
  # if IP_SRCROUTE
  #  include <netinet/in_systm.h>
  #  include <netinet/ip.h>
! #  ifndef __linux__ 
! #    include <netinet/ip_var.h>
! #  endif
  # endif
  
  /*
***************
*** 1570,1584 ****
  		u_char *o;
  		int l;
  		struct in_addr addr;
  		struct ipoption ipopt;
! 
  		ipoptlen = sizeof ipopt;
  		if (getsockopt(fd, IPPROTO_IP, IP_OPTIONS,
  			       (char *) &ipopt, &ipoptlen) < 0)
  			goto noipsr;
  		if (ipoptlen == 0)
  			goto noipsr;
  		o = (u_char *) ipopt.ipopt_list;
  		while (o != NULL && o < (u_char *) &ipopt + ipoptlen)
  		{
  			switch (*o)
--- 1572,1593 ----
  		u_char *o;
  		int l;
  		struct in_addr addr;
+ # ifndef __linux__
  		struct ipoption ipopt;
! # else
! 		struct ip_options ipopt;
! # endif
  		ipoptlen = sizeof ipopt;
  		if (getsockopt(fd, IPPROTO_IP, IP_OPTIONS,
  			       (char *) &ipopt, &ipoptlen) < 0)
  			goto noipsr;
  		if (ipoptlen == 0)
  			goto noipsr;
+ # ifndef __linux__
  		o = (u_char *) ipopt.ipopt_list;
+ # else
+ 		o = (u_char *) ipopt.__data;
+ # endif
  		while (o != NULL && o < (u_char *) &ipopt + ipoptlen)
  		{
  			switch (*o)
***************
*** 1609,1615 ****
--- 1618,1628 ----
  				snprintf(p, SPACELEFT(hbuf, p), " [%s@%.*s",
  				    *o == IPOPT_SSRR ? "!" : "",
  				    l > 240 ? 120 : l / 2,
+ # ifndef __linux__				    
  				    inet_ntoa(GET_IPOPT_DST(ipopt.ipopt_dst)));
+ # else
+ 				    ipopt.faddr);
+ # endif
  				i = strlen(p);
  				p += i;
  				l -= strlen(p);