ipip.c (f94f3cb37a1c4d44dd2070cc4a6165689bda9c92) | ipip.c (b71d1d426d263b0b6cb5760322efebbfc89d4463) |
---|---|
1/* 2 * Linux NET3: IP/IP protocol decoder. 3 * 4 * Authors: 5 * Sam Lantinga (slouken@cs.ucdavis.edu) 02/01/95 6 * 7 * Fixes: 8 * Alan Cox : Merged and made usable non modular (its so tiny its silly as --- 305 unchanged lines hidden (view full) --- 314 315static int ipip_err(struct sk_buff *skb, u32 info) 316{ 317 318/* All the routers (except for Linux) return only 319 8 bytes of packet payload. It means, that precise relaying of 320 ICMP in the real Internet is absolutely infeasible. 321 */ | 1/* 2 * Linux NET3: IP/IP protocol decoder. 3 * 4 * Authors: 5 * Sam Lantinga (slouken@cs.ucdavis.edu) 02/01/95 6 * 7 * Fixes: 8 * Alan Cox : Merged and made usable non modular (its so tiny its silly as --- 305 unchanged lines hidden (view full) --- 314 315static int ipip_err(struct sk_buff *skb, u32 info) 316{ 317 318/* All the routers (except for Linux) return only 319 8 bytes of packet payload. It means, that precise relaying of 320 ICMP in the real Internet is absolutely infeasible. 321 */ |
322 struct iphdr *iph = (struct iphdr *)skb->data; | 322 const struct iphdr *iph = (const struct iphdr *)skb->data; |
323 const int type = icmp_hdr(skb)->type; 324 const int code = icmp_hdr(skb)->code; 325 struct ip_tunnel *t; 326 int err; 327 328 switch (type) { 329 default: 330 case ICMP_PARAMETERPROB: --- 97 unchanged lines hidden (view full) --- 428 * This function assumes it is being called from dev_queue_xmit() 429 * and that skb is filled properly by that function. 430 */ 431 432static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) 433{ 434 struct ip_tunnel *tunnel = netdev_priv(dev); 435 struct pcpu_tstats *tstats; | 323 const int type = icmp_hdr(skb)->type; 324 const int code = icmp_hdr(skb)->code; 325 struct ip_tunnel *t; 326 int err; 327 328 switch (type) { 329 default: 330 case ICMP_PARAMETERPROB: --- 97 unchanged lines hidden (view full) --- 428 * This function assumes it is being called from dev_queue_xmit() 429 * and that skb is filled properly by that function. 430 */ 431 432static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) 433{ 434 struct ip_tunnel *tunnel = netdev_priv(dev); 435 struct pcpu_tstats *tstats; |
436 struct iphdr *tiph = &tunnel->parms.iph; | 436 const struct iphdr *tiph = &tunnel->parms.iph; |
437 u8 tos = tunnel->parms.iph.tos; 438 __be16 df = tiph->frag_off; 439 struct rtable *rt; /* Route to the other host */ 440 struct net_device *tdev; /* Device to other host */ | 437 u8 tos = tunnel->parms.iph.tos; 438 __be16 df = tiph->frag_off; 439 struct rtable *rt; /* Route to the other host */ 440 struct net_device *tdev; /* Device to other host */ |
441 struct iphdr *old_iph = ip_hdr(skb); | 441 const struct iphdr *old_iph = ip_hdr(skb); |
442 struct iphdr *iph; /* Our new IP header */ 443 unsigned int max_headroom; /* The extra header space needed */ 444 __be32 dst = tiph->daddr; 445 int mtu; 446 447 if (skb->protocol != htons(ETH_P_IP)) 448 goto tx_error; 449 --- 117 unchanged lines hidden (view full) --- 567 dev_kfree_skb(skb); 568 return NETDEV_TX_OK; 569} 570 571static void ipip_tunnel_bind_dev(struct net_device *dev) 572{ 573 struct net_device *tdev = NULL; 574 struct ip_tunnel *tunnel; | 442 struct iphdr *iph; /* Our new IP header */ 443 unsigned int max_headroom; /* The extra header space needed */ 444 __be32 dst = tiph->daddr; 445 int mtu; 446 447 if (skb->protocol != htons(ETH_P_IP)) 448 goto tx_error; 449 --- 117 unchanged lines hidden (view full) --- 567 dev_kfree_skb(skb); 568 return NETDEV_TX_OK; 569} 570 571static void ipip_tunnel_bind_dev(struct net_device *dev) 572{ 573 struct net_device *tdev = NULL; 574 struct ip_tunnel *tunnel; |
575 struct iphdr *iph; | 575 const struct iphdr *iph; |
576 577 tunnel = netdev_priv(dev); 578 iph = &tunnel->parms.iph; 579 580 if (iph->daddr) { 581 struct rtable *rt = ip_route_output_ports(dev_net(dev), NULL, 582 iph->daddr, iph->saddr, 583 0, 0, --- 326 unchanged lines hidden --- | 576 577 tunnel = netdev_priv(dev); 578 iph = &tunnel->parms.iph; 579 580 if (iph->daddr) { 581 struct rtable *rt = ip_route_output_ports(dev_net(dev), NULL, 582 iph->daddr, iph->saddr, 583 0, 0, --- 326 unchanged lines hidden --- |