2 ; This is simple hack to get 2.2.x kernel working with
3 ; glibc 2.1.x AND glibc 2.2 library (changes in struct sockaddr_in6).
4 ; Arkadiusz Miskiewicz <misiek@pld.org.pl>, PLD GNU/Linux
6 ; Note: I'm not kernel hacker ! You have been warned.
7 diff -urN linux-2.2.x.org/include/linux/in6.h linux-2.2.x/include/linux/in6.h
8 --- linux-2.2.x.org/include/linux/in6.h Tue Nov 21 16:02:16 2000
9 +++ linux-2.2.x/include/linux/in6.h Tue Nov 21 16:02:35 2000
11 __u16 sin6_port; /* Transport layer port # */
12 __u32 sin6_flowinfo; /* IPv6 flow information */
13 struct in6_addr sin6_addr; /* IPv6 address */
14 + __u32 sin6_scope_id; /* scope id (new in RFC2553) */
18 diff -urN linux-2.2.x.org/include/net/ipv6.h linux-2.2.x/include/net/ipv6.h
19 --- linux-2.2.x.org/include/net/ipv6.h Tue Nov 21 16:02:17 2000
20 +++ linux-2.2.x/include/net/ipv6.h Tue Nov 21 16:02:35 2000
22 #include <net/ndisc.h>
25 +#define SIN6_LEN_RFC2133 24
28 * NextHeader field of IPv6 header
30 diff -urN linux-2.2.x.org/net/ipv6/af_inet6.c linux-2.2.x/net/ipv6/af_inet6.c
31 --- linux-2.2.x.org/net/ipv6/af_inet6.c Tue Nov 21 16:02:18 2000
32 +++ linux-2.2.x/net/ipv6/af_inet6.c Tue Nov 21 16:04:00 2000
35 /* Check these errors (active socket, bad address length, double bind). */
36 if ((sk->state != TCP_CLOSE) ||
37 - (addr_len < sizeof(struct sockaddr_in6)) ||
38 + (addr_len < SIN6_LEN_RFC2133) ||
44 sin->sin6_family = AF_INET6;
45 sin->sin6_flowinfo = 0;
46 + sin->sin6_scope_id = 0;
49 if (!tcp_connected(sk->state))
50 diff -urN linux-2.2.x.org/net/ipv6/datagram.c linux-2.2.x/net/ipv6/datagram.c
51 --- linux-2.2.x.org/net/ipv6/datagram.c Tue Nov 21 16:02:18 2000
52 +++ linux-2.2.x/net/ipv6/datagram.c Tue Nov 21 16:05:29 2000
55 sin->sin6_family = AF_INET6;
56 sin->sin6_flowinfo = 0;
57 + sin->sin6_scope_id = 0;
58 sin->sin6_port = serr->port;
59 if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP6) {
60 memcpy(&sin->sin6_addr, skb->nh.raw + serr->addr_offset, 16);
62 if (serr->ee.ee_origin != SO_EE_ORIGIN_LOCAL) {
63 sin->sin6_family = AF_INET6;
64 sin->sin6_flowinfo = 0;
65 + sin->sin6_scope_id = 0;
66 if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP6) {
67 memcpy(&sin->sin6_addr, &skb->nh.ipv6h->saddr, 16);
68 if (sk->net_pinfo.af_inet6.rxopt.all)
69 diff -urN linux-2.2.x.org/net/ipv6/raw.c linux-2.2.x/net/ipv6/raw.c
70 --- linux-2.2.x.org/net/ipv6/raw.c Tue Nov 21 16:02:18 2000
71 +++ linux-2.2.x/net/ipv6/raw.c Tue Nov 21 16:08:12 2000
75 /* Check these errors. */
76 - if (sk->state != TCP_CLOSE || (addr_len < sizeof(struct sockaddr_in6)))
77 + if (sk->state != TCP_CLOSE || (addr_len < SIN6_LEN_RFC2133))
80 addr_type = ipv6_addr_type(&addr->sin6_addr);
82 memcpy(&sin6->sin6_addr, &skb->nh.ipv6h->saddr,
83 sizeof(struct in6_addr));
84 sin6->sin6_flowinfo = 0;
85 + sin6->sin6_scope_id = 0;
88 if (sk->net_pinfo.af_inet6.rxopt.all)
93 - if (addr_len < sizeof(struct sockaddr_in6))
94 + if (addr_len < SIN6_LEN_RFC2133)
97 if (sin6->sin6_family && sin6->sin6_family != AF_INET6)
98 diff -urN linux-2.2.x.org/net/ipv6/tcp_ipv6.c linux-2.2.x/net/ipv6/tcp_ipv6.c
99 --- linux-2.2.x.org/net/ipv6/tcp_ipv6.c Tue Nov 21 16:02:18 2000
100 +++ linux-2.2.x/net/ipv6/tcp_ipv6.c Tue Nov 21 16:08:44 2000
102 if(!ipv6_addr_any(&np->daddr))
105 - if (addr_len < sizeof(struct sockaddr_in6))
106 + if (addr_len < SIN6_LEN_RFC2133)
109 if (usin->sin6_family && usin->sin6_family != AF_INET6)
110 @@ -1583,6 +1583,7 @@
111 sin6->sin6_port = sk->dport;
112 /* We do not store received flowlabel for TCP */
113 sin6->sin6_flowinfo = 0;
114 + sin6->sin6_scope_id = 0;
117 static struct tcp_func ipv6_specific = {
118 diff -urN linux-2.2.x.org/net/ipv6/udp.c linux-2.2.x/net/ipv6/udp.c
119 --- linux-2.2.x.org/net/ipv6/udp.c Tue Nov 21 16:02:18 2000
120 +++ linux-2.2.x/net/ipv6/udp.c Tue Nov 21 16:08:56 2000
125 - if (addr_len < sizeof(*usin))
126 + if (addr_len < SIN6_LEN_RFC2133)
129 if (usin->sin6_family && usin->sin6_family != AF_INET6)
131 sin6->sin6_family = AF_INET6;
132 sin6->sin6_port = skb->h.uh->source;
133 sin6->sin6_flowinfo = 0;
134 + sin6->sin6_scope_id = 0;
136 if (skb->protocol == __constant_htons(ETH_P_IP)) {
137 ipv6_addr_set(&sin6->sin6_addr, 0, 0,
139 if (sin6->sin6_family == AF_INET)
140 return udp_sendmsg(sk, msg, ulen);
142 - if (addr_len < sizeof(*sin6))
143 + if (addr_len < SIN6_LEN_RFC2133)
146 if (sin6->sin6_family && sin6->sin6_family != AF_INET6)