ip_options.c (db985cbd67c45f875ef43cb5febfaa8cbd203c27) | ip_options.c (24a2d43d8886f5a29c3cf108927f630c545a9a38) |
---|---|
1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * The options processing module for ip.c 7 * 8 * Authors: A.N.Kuznetsov --- 73 unchanged lines hidden (view full) --- 82 * Provided (sopt, skb) points to received options, 83 * build in dopt compiled option set appropriate for answering. 84 * i.e. invert SRR option, copy anothers, 85 * and grab room in RR/TS options. 86 * 87 * NOTE: dopt cannot point to skb. 88 */ 89 | 1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * The options processing module for ip.c 7 * 8 * Authors: A.N.Kuznetsov --- 73 unchanged lines hidden (view full) --- 82 * Provided (sopt, skb) points to received options, 83 * build in dopt compiled option set appropriate for answering. 84 * i.e. invert SRR option, copy anothers, 85 * and grab room in RR/TS options. 86 * 87 * NOTE: dopt cannot point to skb. 88 */ 89 |
90int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb) | 90int __ip_options_echo(struct ip_options *dopt, struct sk_buff *skb, 91 const struct ip_options *sopt) |
91{ | 92{ |
92 const struct ip_options *sopt; | |
93 unsigned char *sptr, *dptr; 94 int soffset, doffset; 95 int optlen; 96 97 memset(dopt, 0, sizeof(struct ip_options)); 98 | 93 unsigned char *sptr, *dptr; 94 int soffset, doffset; 95 int optlen; 96 97 memset(dopt, 0, sizeof(struct ip_options)); 98 |
99 sopt = &(IPCB(skb)->opt); 100 | |
101 if (sopt->optlen == 0) 102 return 0; 103 104 sptr = skb_network_header(skb); 105 dptr = dopt->__data; 106 107 if (sopt->rr) { 108 optlen = sptr[sopt->rr+1]; --- 557 unchanged lines hidden --- | 99 if (sopt->optlen == 0) 100 return 0; 101 102 sptr = skb_network_header(skb); 103 dptr = dopt->__data; 104 105 if (sopt->rr) { 106 optlen = sptr[sopt->rr+1]; --- 557 unchanged lines hidden --- |