ip_options.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  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
  9. *
  10. */
  11. #include <linux/capability.h>
  12. #include <linux/module.h>
  13. #include <linux/slab.h>
  14. #include <linux/types.h>
  15. #include <asm/uaccess.h>
  16. #include <asm/unaligned.h>
  17. #include <linux/skbuff.h>
  18. #include <linux/ip.h>
  19. #include <linux/icmp.h>
  20. #include <linux/netdevice.h>
  21. #include <linux/rtnetlink.h>
  22. #include <net/sock.h>
  23. #include <net/ip.h>
  24. #include <net/icmp.h>
  25. #include <net/route.h>
  26. #include <net/cipso_ipv4.h>
  27. /*
  28. * Write options to IP header, record destination address to
  29. * source route option, address of outgoing interface
  30. * (we should already know it, so that this function is allowed be
  31. * called only after routing decision) and timestamp,
  32. * if we originate this datagram.
  33. *
  34. * daddr is real destination address, next hop is recorded in IP header.
  35. * saddr is address of outgoing interface.
  36. */
  37. void ip_options_build(struct sk_buff *skb, struct ip_options *opt,
  38. __be32 daddr, struct rtable *rt, int is_frag)
  39. {
  40. unsigned char *iph = skb_network_header(skb);
  41. memcpy(&(IPCB(skb)->opt), opt, sizeof(struct ip_options));
  42. memcpy(iph+sizeof(struct iphdr), opt->__data, opt->optlen);
  43. opt = &(IPCB(skb)->opt);
  44. if (opt->srr)
  45. memcpy(iph+opt->srr+iph[opt->srr+1]-4, &daddr, 4);
  46. if (!is_frag) {
  47. if (opt->rr_needaddr)
  48. ip_rt_get_source(iph+opt->rr+iph[opt->rr+2]-5, skb, rt);
  49. if (opt->ts_needaddr)
  50. ip_rt_get_source(iph+opt->ts+iph[opt->ts+2]-9, skb, rt);
  51. if (opt->ts_needtime) {
  52. struct timespec tv;
  53. __be32 midtime;
  54. getnstimeofday(&tv);
  55. midtime = htonl((tv.tv_sec % 86400) * MSEC_PER_SEC + tv.tv_nsec / NSEC_PER_MSEC);
  56. memcpy(iph+opt->ts+iph[opt->ts+2]-5, &midtime, 4);
  57. }
  58. return;
  59. }
  60. if (opt->rr) {
  61. memset(iph+opt->rr, IPOPT_NOP, iph[opt->rr+1]);
  62. opt->rr = 0;
  63. opt->rr_needaddr = 0;
  64. }
  65. if (opt->ts) {
  66. memset(iph+opt->ts, IPOPT_NOP, iph[opt->ts+1]);
  67. opt->ts = 0;
  68. opt->ts_needaddr = opt->ts_needtime = 0;
  69. }
  70. }
  71. /*
  72. * Provided (sopt, skb) points to received options,
  73. * build in dopt compiled option set appropriate for answering.
  74. * i.e. invert SRR option, copy anothers,
  75. * and grab room in RR/TS options.
  76. *
  77. * NOTE: dopt cannot point to skb.
  78. */
  79. int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb)
  80. {
  81. const struct ip_options *sopt;
  82. unsigned char *sptr, *dptr;
  83. int soffset, doffset;
  84. int optlen;
  85. __be32 daddr;
  86. memset(dopt, 0, sizeof(struct ip_options));
  87. sopt = &(IPCB(skb)->opt);
  88. if (sopt->optlen == 0)
  89. return 0;
  90. sptr = skb_network_header(skb);
  91. dptr = dopt->__data;
  92. daddr = skb_rtable(skb)->rt_spec_dst;
  93. if (sopt->rr) {
  94. optlen = sptr[sopt->rr+1];
  95. soffset = sptr[sopt->rr+2];
  96. dopt->rr = dopt->optlen + sizeof(struct iphdr);
  97. memcpy(dptr, sptr+sopt->rr, optlen);
  98. if (sopt->rr_needaddr && soffset <= optlen) {
  99. if (soffset + 3 > optlen)
  100. return -EINVAL;
  101. dptr[2] = soffset + 4;
  102. dopt->rr_needaddr = 1;
  103. }
  104. dptr += optlen;
  105. dopt->optlen += optlen;
  106. }
  107. if (sopt->ts) {
  108. optlen = sptr[sopt->ts+1];
  109. soffset = sptr[sopt->ts+2];
  110. dopt->ts = dopt->optlen + sizeof(struct iphdr);
  111. memcpy(dptr, sptr+sopt->ts, optlen);
  112. if (soffset <= optlen) {
  113. if (sopt->ts_needaddr) {
  114. if (soffset + 3 > optlen)
  115. return -EINVAL;
  116. dopt->ts_needaddr = 1;
  117. soffset += 4;
  118. }
  119. if (sopt->ts_needtime) {
  120. if (soffset + 3 > optlen)
  121. return -EINVAL;
  122. if ((dptr[3]&0xF) != IPOPT_TS_PRESPEC) {
  123. dopt->ts_needtime = 1;
  124. soffset += 4;
  125. } else {
  126. dopt->ts_needtime = 0;
  127. if (soffset + 7 <= optlen) {
  128. __be32 addr;
  129. memcpy(&addr, dptr+soffset-1, 4);
  130. if (inet_addr_type(dev_net(skb_dst(skb)->dev), addr) != RTN_UNICAST) {
  131. dopt->ts_needtime = 1;
  132. soffset += 8;
  133. }
  134. }
  135. }
  136. }
  137. dptr[2] = soffset;
  138. }
  139. dptr += optlen;
  140. dopt->optlen += optlen;
  141. }
  142. if (sopt->srr) {
  143. unsigned char *start = sptr+sopt->srr;
  144. __be32 faddr;
  145. optlen = start[1];
  146. soffset = start[2];
  147. doffset = 0;
  148. if (soffset > optlen)
  149. soffset = optlen + 1;
  150. soffset -= 4;
  151. if (soffset > 3) {
  152. memcpy(&faddr, &start[soffset-1], 4);
  153. for (soffset-=4, doffset=4; soffset > 3; soffset-=4, doffset+=4)
  154. memcpy(&dptr[doffset-1], &start[soffset-1], 4);
  155. /*
  156. * RFC1812 requires to fix illegal source routes.
  157. */
  158. if (memcmp(&ip_hdr(skb)->saddr,
  159. &start[soffset + 3], 4) == 0)
  160. doffset -= 4;
  161. }
  162. if (doffset > 3) {
  163. memcpy(&start[doffset-1], &daddr, 4);
  164. dopt->faddr = faddr;
  165. dptr[0] = start[0];
  166. dptr[1] = doffset+3;
  167. dptr[2] = 4;
  168. dptr += doffset+3;
  169. dopt->srr = dopt->optlen + sizeof(struct iphdr);
  170. dopt->optlen += doffset+3;
  171. dopt->is_strictroute = sopt->is_strictroute;
  172. }
  173. }
  174. if (sopt->cipso) {
  175. optlen = sptr[sopt->cipso+1];
  176. dopt->cipso = dopt->optlen+sizeof(struct iphdr);
  177. memcpy(dptr, sptr+sopt->cipso, optlen);
  178. dptr += optlen;
  179. dopt->optlen += optlen;
  180. }
  181. while (dopt->optlen & 3) {
  182. *dptr++ = IPOPT_END;
  183. dopt->optlen++;
  184. }
  185. return 0;
  186. }
  187. /*
  188. * Options "fragmenting", just fill options not
  189. * allowed in fragments with NOOPs.
  190. * Simple and stupid 8), but the most efficient way.
  191. */
  192. void ip_options_fragment(struct sk_buff * skb)
  193. {
  194. unsigned char *optptr = skb_network_header(skb) + sizeof(struct iphdr);
  195. struct ip_options * opt = &(IPCB(skb)->opt);
  196. int l = opt->optlen;
  197. int optlen;
  198. while (l > 0) {
  199. switch (*optptr) {
  200. case IPOPT_END:
  201. return;
  202. case IPOPT_NOOP:
  203. l--;
  204. optptr++;
  205. continue;
  206. }
  207. optlen = optptr[1];
  208. if (optlen<2 || optlen>l)
  209. return;
  210. if (!IPOPT_COPIED(*optptr))
  211. memset(optptr, IPOPT_NOOP, optlen);
  212. l -= optlen;
  213. optptr += optlen;
  214. }
  215. opt->ts = 0;
  216. opt->rr = 0;
  217. opt->rr_needaddr = 0;
  218. opt->ts_needaddr = 0;
  219. opt->ts_needtime = 0;
  220. }
  221. /*
  222. * Verify options and fill pointers in struct options.
  223. * Caller should clear *opt, and set opt->data.
  224. * If opt == NULL, then skb->data should point to IP header.
  225. */
  226. int ip_options_compile(struct net *net,
  227. struct ip_options * opt, struct sk_buff * skb)
  228. {
  229. int l;
  230. unsigned char * iph;
  231. unsigned char * optptr;
  232. int optlen;
  233. unsigned char * pp_ptr = NULL;
  234. struct rtable *rt = NULL;
  235. if (skb != NULL) {
  236. rt = skb_rtable(skb);
  237. optptr = (unsigned char *)&(ip_hdr(skb)[1]);
  238. } else
  239. optptr = opt->__data;
  240. iph = optptr - sizeof(struct iphdr);
  241. for (l = opt->optlen; l > 0; ) {
  242. switch (*optptr) {
  243. case IPOPT_END:
  244. for (optptr++, l--; l>0; optptr++, l--) {
  245. if (*optptr != IPOPT_END) {
  246. *optptr = IPOPT_END;
  247. opt->is_changed = 1;
  248. }
  249. }
  250. goto eol;
  251. case IPOPT_NOOP:
  252. l--;
  253. optptr++;
  254. continue;
  255. }
  256. optlen = optptr[1];
  257. if (optlen<2 || optlen>l) {
  258. pp_ptr = optptr;
  259. goto error;
  260. }
  261. switch (*optptr) {
  262. case IPOPT_SSRR:
  263. case IPOPT_LSRR:
  264. if (optlen < 3) {
  265. pp_ptr = optptr + 1;
  266. goto error;
  267. }
  268. if (optptr[2] < 4) {
  269. pp_ptr = optptr + 2;
  270. goto error;
  271. }
  272. /* NB: cf RFC-1812 5.2.4.1 */
  273. if (opt->srr) {
  274. pp_ptr = optptr;
  275. goto error;
  276. }
  277. if (!skb) {
  278. if (optptr[2] != 4 || optlen < 7 || ((optlen-3) & 3)) {
  279. pp_ptr = optptr + 1;
  280. goto error;
  281. }
  282. memcpy(&opt->faddr, &optptr[3], 4);
  283. if (optlen > 7)
  284. memmove(&optptr[3], &optptr[7], optlen-7);
  285. }
  286. opt->is_strictroute = (optptr[0] == IPOPT_SSRR);
  287. opt->srr = optptr - iph;
  288. break;
  289. case IPOPT_RR:
  290. if (opt->rr) {
  291. pp_ptr = optptr;
  292. goto error;
  293. }
  294. if (optlen < 3) {
  295. pp_ptr = optptr + 1;
  296. goto error;
  297. }
  298. if (optptr[2] < 4) {
  299. pp_ptr = optptr + 2;
  300. goto error;
  301. }
  302. if (optptr[2] <= optlen) {
  303. if (optptr[2]+3 > optlen) {
  304. pp_ptr = optptr + 2;
  305. goto error;
  306. }
  307. if (rt) {
  308. memcpy(&optptr[optptr[2]-1], &rt->rt_spec_dst, 4);
  309. opt->is_changed = 1;
  310. }
  311. optptr[2] += 4;
  312. opt->rr_needaddr = 1;
  313. }
  314. opt->rr = optptr - iph;
  315. break;
  316. case IPOPT_TIMESTAMP:
  317. if (opt->ts) {
  318. pp_ptr = optptr;
  319. goto error;
  320. }
  321. if (optlen < 4) {
  322. pp_ptr = optptr + 1;
  323. goto error;
  324. }
  325. if (optptr[2] < 5) {
  326. pp_ptr = optptr + 2;
  327. goto error;
  328. }
  329. if (optptr[2] <= optlen) {
  330. unsigned char *timeptr = NULL;
  331. if (optptr[2]+3 > optptr[1]) {
  332. pp_ptr = optptr + 2;
  333. goto error;
  334. }
  335. switch (optptr[3]&0xF) {
  336. case IPOPT_TS_TSONLY:
  337. opt->ts = optptr - iph;
  338. if (skb)
  339. timeptr = &optptr[optptr[2]-1];
  340. opt->ts_needtime = 1;
  341. optptr[2] += 4;
  342. break;
  343. case IPOPT_TS_TSANDADDR:
  344. if (optptr[2]+7 > optptr[1]) {
  345. pp_ptr = optptr + 2;
  346. goto error;
  347. }
  348. opt->ts = optptr - iph;
  349. if (rt) {
  350. memcpy(&optptr[optptr[2]-1], &rt->rt_spec_dst, 4);
  351. timeptr = &optptr[optptr[2]+3];
  352. }
  353. opt->ts_needaddr = 1;
  354. opt->ts_needtime = 1;
  355. optptr[2] += 8;
  356. break;
  357. case IPOPT_TS_PRESPEC:
  358. if (optptr[2]+7 > optptr[1]) {
  359. pp_ptr = optptr + 2;
  360. goto error;
  361. }
  362. opt->ts = optptr - iph;
  363. {
  364. __be32 addr;
  365. memcpy(&addr, &optptr[optptr[2]-1], 4);
  366. if (inet_addr_type(net, addr) == RTN_UNICAST)
  367. break;
  368. if (skb)
  369. timeptr = &optptr[optptr[2]+3];
  370. }
  371. opt->ts_needtime = 1;
  372. optptr[2] += 8;
  373. break;
  374. default:
  375. if (!skb && !capable(CAP_NET_RAW)) {
  376. pp_ptr = optptr + 3;
  377. goto error;
  378. }
  379. break;
  380. }
  381. if (timeptr) {
  382. struct timespec tv;
  383. u32 midtime;
  384. getnstimeofday(&tv);
  385. midtime = (tv.tv_sec % 86400) * MSEC_PER_SEC + tv.tv_nsec / NSEC_PER_MSEC;
  386. put_unaligned_be32(midtime, timeptr);
  387. opt->is_changed = 1;
  388. }
  389. } else {
  390. unsigned overflow = optptr[3]>>4;
  391. if (overflow == 15) {
  392. pp_ptr = optptr + 3;
  393. goto error;
  394. }
  395. opt->ts = optptr - iph;
  396. if (skb) {
  397. optptr[3] = (optptr[3]&0xF)|((overflow+1)<<4);
  398. opt->is_changed = 1;
  399. }
  400. }
  401. break;
  402. case IPOPT_RA:
  403. if (optlen < 4) {
  404. pp_ptr = optptr + 1;
  405. goto error;
  406. }
  407. if (optptr[2] == 0 && optptr[3] == 0)
  408. opt->router_alert = optptr - iph;
  409. break;
  410. case IPOPT_CIPSO:
  411. if ((!skb && !capable(CAP_NET_RAW)) || opt->cipso) {
  412. pp_ptr = optptr;
  413. goto error;
  414. }
  415. opt->cipso = optptr - iph;
  416. if (cipso_v4_validate(skb, &optptr)) {
  417. pp_ptr = optptr;
  418. goto error;
  419. }
  420. break;
  421. case IPOPT_SEC:
  422. case IPOPT_SID:
  423. default:
  424. if (!skb && !capable(CAP_NET_RAW)) {
  425. pp_ptr = optptr;
  426. goto error;
  427. }
  428. break;
  429. }
  430. l -= optlen;
  431. optptr += optlen;
  432. }
  433. eol:
  434. if (!pp_ptr)
  435. return 0;
  436. error:
  437. if (skb) {
  438. icmp_send(skb, ICMP_PARAMETERPROB, 0, htonl((pp_ptr-iph)<<24));
  439. }
  440. return -EINVAL;
  441. }
  442. EXPORT_SYMBOL(ip_options_compile);
  443. /*
  444. * Undo all the changes done by ip_options_compile().
  445. */
  446. void ip_options_undo(struct ip_options * opt)
  447. {
  448. if (opt->srr) {
  449. unsigned char * optptr = opt->__data+opt->srr-sizeof(struct iphdr);
  450. memmove(optptr+7, optptr+3, optptr[1]-7);
  451. memcpy(optptr+3, &opt->faddr, 4);
  452. }
  453. if (opt->rr_needaddr) {
  454. unsigned char * optptr = opt->__data+opt->rr-sizeof(struct iphdr);
  455. optptr[2] -= 4;
  456. memset(&optptr[optptr[2]-1], 0, 4);
  457. }
  458. if (opt->ts) {
  459. unsigned char * optptr = opt->__data+opt->ts-sizeof(struct iphdr);
  460. if (opt->ts_needtime) {
  461. optptr[2] -= 4;
  462. memset(&optptr[optptr[2]-1], 0, 4);
  463. if ((optptr[3]&0xF) == IPOPT_TS_PRESPEC)
  464. optptr[2] -= 4;
  465. }
  466. if (opt->ts_needaddr) {
  467. optptr[2] -= 4;
  468. memset(&optptr[optptr[2]-1], 0, 4);
  469. }
  470. }
  471. }
  472. static struct ip_options_rcu *ip_options_get_alloc(const int optlen)
  473. {
  474. return kzalloc(sizeof(struct ip_options_rcu) + ((optlen + 3) & ~3),
  475. GFP_KERNEL);
  476. }
  477. static int ip_options_get_finish(struct net *net, struct ip_options_rcu **optp,
  478. struct ip_options_rcu *opt, int optlen)
  479. {
  480. while (optlen & 3)
  481. opt->opt.__data[optlen++] = IPOPT_END;
  482. opt->opt.optlen = optlen;
  483. if (optlen && ip_options_compile(net, &opt->opt, NULL)) {
  484. kfree(opt);
  485. return -EINVAL;
  486. }
  487. kfree(*optp);
  488. *optp = opt;
  489. return 0;
  490. }
  491. int ip_options_get_from_user(struct net *net, struct ip_options_rcu **optp,
  492. unsigned char __user *data, int optlen)
  493. {
  494. struct ip_options_rcu *opt = ip_options_get_alloc(optlen);
  495. if (!opt)
  496. return -ENOMEM;
  497. if (optlen && copy_from_user(opt->opt.__data, data, optlen)) {
  498. kfree(opt);
  499. return -EFAULT;
  500. }
  501. return ip_options_get_finish(net, optp, opt, optlen);
  502. }
  503. int ip_options_get(struct net *net, struct ip_options_rcu **optp,
  504. unsigned char *data, int optlen)
  505. {
  506. struct ip_options_rcu *opt = ip_options_get_alloc(optlen);
  507. if (!opt)
  508. return -ENOMEM;
  509. if (optlen)
  510. memcpy(opt->opt.__data, data, optlen);
  511. return ip_options_get_finish(net, optp, opt, optlen);
  512. }
  513. void ip_forward_options(struct sk_buff *skb)
  514. {
  515. struct ip_options * opt = &(IPCB(skb)->opt);
  516. unsigned char * optptr;
  517. struct rtable *rt = skb_rtable(skb);
  518. unsigned char *raw = skb_network_header(skb);
  519. if (opt->rr_needaddr) {
  520. optptr = (unsigned char *)raw + opt->rr;
  521. ip_rt_get_source(&optptr[optptr[2]-5], skb, rt);
  522. opt->is_changed = 1;
  523. }
  524. if (opt->srr_is_hit) {
  525. int srrptr, srrspace;
  526. optptr = raw + opt->srr;
  527. for ( srrptr=optptr[2], srrspace = optptr[1];
  528. srrptr <= srrspace;
  529. srrptr += 4
  530. ) {
  531. if (srrptr + 3 > srrspace)
  532. break;
  533. if (memcmp(&opt->nexthop, &optptr[srrptr-1], 4) == 0)
  534. break;
  535. }
  536. if (srrptr + 3 <= srrspace) {
  537. opt->is_changed = 1;
  538. ip_hdr(skb)->daddr = opt->nexthop;
  539. ip_rt_get_source(&optptr[srrptr-1], skb, rt);
  540. optptr[2] = srrptr+4;
  541. } else if (net_ratelimit())
  542. printk(KERN_CRIT "ip_forward(): Argh! Destination lost!\n");
  543. if (opt->ts_needaddr) {
  544. optptr = raw + opt->ts;
  545. ip_rt_get_source(&optptr[optptr[2]-9], skb, rt);
  546. opt->is_changed = 1;
  547. }
  548. }
  549. if (opt->is_changed) {
  550. opt->is_changed = 0;
  551. ip_send_check(ip_hdr(skb));
  552. }
  553. }
  554. int ip_options_rcv_srr(struct sk_buff *skb)
  555. {
  556. struct ip_options *opt = &(IPCB(skb)->opt);
  557. int srrspace, srrptr;
  558. __be32 nexthop;
  559. struct iphdr *iph = ip_hdr(skb);
  560. unsigned char *optptr = skb_network_header(skb) + opt->srr;
  561. struct rtable *rt = skb_rtable(skb);
  562. struct rtable *rt2;
  563. unsigned long orefdst;
  564. int err;
  565. if (!rt)
  566. return 0;
  567. if (skb->pkt_type != PACKET_HOST)
  568. return -EINVAL;
  569. if (rt->rt_type == RTN_UNICAST) {
  570. if (!opt->is_strictroute)
  571. return 0;
  572. icmp_send(skb, ICMP_PARAMETERPROB, 0, htonl(16<<24));
  573. return -EINVAL;
  574. }
  575. if (rt->rt_type != RTN_LOCAL)
  576. return -EINVAL;
  577. for (srrptr=optptr[2], srrspace = optptr[1]; srrptr <= srrspace; srrptr += 4) {
  578. if (srrptr + 3 > srrspace) {
  579. icmp_send(skb, ICMP_PARAMETERPROB, 0, htonl((opt->srr+2)<<24));
  580. return -EINVAL;
  581. }
  582. memcpy(&nexthop, &optptr[srrptr-1], 4);
  583. orefdst = skb->_skb_refdst;
  584. skb_dst_set(skb, NULL);
  585. err = ip_route_input(skb, nexthop, iph->saddr, iph->tos, skb->dev);
  586. rt2 = skb_rtable(skb);
  587. if (err || (rt2->rt_type != RTN_UNICAST && rt2->rt_type != RTN_LOCAL)) {
  588. skb_dst_drop(skb);
  589. skb->_skb_refdst = orefdst;
  590. return -EINVAL;
  591. }
  592. refdst_drop(orefdst);
  593. if (rt2->rt_type != RTN_LOCAL)
  594. break;
  595. /* Superfast 8) loopback forward */
  596. iph->daddr = nexthop;
  597. opt->is_changed = 1;
  598. }
  599. if (srrptr <= srrspace) {
  600. opt->srr_is_hit = 1;
  601. opt->nexthop = nexthop;
  602. opt->is_changed = 1;
  603. }
  604. return 0;
  605. }
  606. EXPORT_SYMBOL(ip_options_rcv_srr);