cregit-Linux how code gets into the kernel

Release 4.11 net/ipv6/xfrm6_input.c

Directory: net/ipv6
/*
 * xfrm6_input.c: based on net/ipv4/xfrm4_input.c
 *
 * Authors:
 *      Mitsuru KANDA @USAGI
 *      Kazunori MIYAZAWA @USAGI
 *      Kunihiro Ishiguro <kunihiro@ipinfusion.com>
 *      YOSHIFUJI Hideaki @USAGI
 *              IPv6 support
 */

#include <linux/module.h>
#include <linux/string.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv6.h>
#include <net/ipv6.h>
#include <net/xfrm.h>


int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb) { return xfrm6_extract_header(skb); }

Contributors

PersonTokensPropCommitsCommitProp
Herbert Xu21100.00%1100.00%
Total21100.00%1100.00%


int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi, struct ip6_tnl *t) { XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6 = t; XFRM_SPI_SKB_CB(skb)->family = AF_INET6; XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct ipv6hdr, daddr); return xfrm_input(skb, nexthdr, spi, 0); }

Contributors

PersonTokensPropCommitsCommitProp
Herbert Xu2841.18%650.00%
Hideaki Yoshifuji / 吉藤英明1927.94%216.67%
Alexey Kodanev1014.71%18.33%
Nicolas Dichtel68.82%18.33%
Patrick McHardy45.88%18.33%
Al Viro11.47%18.33%
Total68100.00%12100.00%

EXPORT_SYMBOL(xfrm6_rcv_spi);
int xfrm6_transport_finish(struct sk_buff *skb, int async) { struct xfrm_offload *xo = xfrm_offload(skb); skb_network_header(skb)[IP6CB(skb)->nhoff] = XFRM_MODE_SKB_CB(skb)->protocol; #ifndef CONFIG_NETFILTER if (!async) return 1; #endif ipv6_hdr(skb)->payload_len = htons(skb->len); __skb_push(skb, skb->data - skb_network_header(skb)); if (xo && (xo->flags & XFRM_GRO)) { skb_mac_header_rebuild(skb); return -1; } NF_HOOK(NFPROTO_IPV6, NF_INET_PRE_ROUTING, dev_net(skb->dev), NULL, skb, skb->dev, NULL, ip6_rcv_finish); return -1; }

Contributors

PersonTokensPropCommitsCommitProp
Patrick McHardy4331.39%216.67%
Herbert Xu4230.66%325.00%
Steffen Klassert3324.09%18.33%
Eric W. Biedermann75.11%18.33%
Arnaldo Carvalho de Melo64.38%216.67%
Hideaki Yoshifuji / 吉藤英明32.19%18.33%
David S. Miller21.46%18.33%
Jan Engelhardt10.73%18.33%
Total137100.00%12100.00%


int xfrm6_rcv_tnl(struct sk_buff *skb, struct ip6_tnl *t) { return xfrm6_rcv_spi(skb, skb_network_header(skb)[IP6CB(skb)->nhoff], 0, t); }

Contributors

PersonTokensPropCommitsCommitProp
Herbert Xu2771.05%375.00%
Nicolas Dichtel1128.95%125.00%
Total38100.00%4100.00%

EXPORT_SYMBOL(xfrm6_rcv_tnl);
int xfrm6_rcv(struct sk_buff *skb) { return xfrm6_rcv_tnl(skb, NULL); }

Contributors

PersonTokensPropCommitsCommitProp
Nicolas Dichtel1583.33%150.00%
Herbert Xu316.67%150.00%
Total18100.00%2100.00%

EXPORT_SYMBOL(xfrm6_rcv);
int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, xfrm_address_t *saddr, u8 proto) { struct net *net = dev_net(skb->dev); struct xfrm_state *x = NULL; int i = 0; if (secpath_set(skb)) { XFRM_INC_STATS(net, LINUX_MIB_XFRMINERROR); goto drop; } if (1 + skb->sp->len == XFRM_MAX_DEPTH) { XFRM_INC_STATS(net, LINUX_MIB_XFRMINBUFFERERROR); goto drop; } for (i = 0; i < 3; i++) { xfrm_address_t *dst, *src; switch (i) { case 0: dst = daddr; src = saddr; break; case 1: /* lookup state with wild-card source address */ dst = daddr; src = (xfrm_address_t *)&in6addr_any; break; default: /* lookup state with wild-card addresses */ dst = (xfrm_address_t *)&in6addr_any; src = (xfrm_address_t *)&in6addr_any; break; } x = xfrm_state_lookup_byaddr(net, skb->mark, dst, src, proto, AF_INET6); if (!x) continue; spin_lock(&x->lock); if ((!i || (x->props.flags & XFRM_STATE_WILDRECV)) && likely(x->km.state == XFRM_STATE_VALID) && !xfrm_state_check_expire(x)) { spin_unlock(&x->lock); if (x->type->input(x, skb) > 0) { /* found a valid state */ break; } } else spin_unlock(&x->lock); xfrm_state_put(x); x = NULL; } if (!x) { XFRM_INC_STATS(net, LINUX_MIB_XFRMINNOSTATES); xfrm_audit_state_notfound_simple(skb, AF_INET6); goto drop; } skb->sp->xvec[skb->sp->len++] = x; spin_lock(&x->lock); x->curlft.bytes += skb->len; x->curlft.packets++; spin_unlock(&x->lock); return 1; drop: return -1; }

Contributors

PersonTokensPropCommitsCommitProp
Masahide Nakamura28779.06%333.33%
Hideaki Yoshifuji / 吉藤英明4412.12%111.11%
Alexey Dobriyan205.51%222.22%
Paul Moore71.93%111.11%
Jamal Hadi Salim41.10%111.11%
Steffen Klassert10.28%111.11%
Total363100.00%9100.00%

EXPORT_SYMBOL(xfrm6_input_addr);

Overall Contributors

PersonTokensPropCommitsCommitProp
Masahide Nakamura28741.96%38.57%
Herbert Xu12918.86%1028.57%
Hideaki Yoshifuji / 吉藤英明8512.43%411.43%
Patrick McHardy537.75%38.57%
Nicolas Dichtel375.41%12.86%
Steffen Klassert344.97%25.71%
Alexey Dobriyan202.92%25.71%
Alexey Kodanev101.46%12.86%
Eric W. Biedermann71.02%12.86%
Paul Moore71.02%12.86%
Arnaldo Carvalho de Melo60.88%25.71%
Jamal Hadi Salim40.58%12.86%
David S. Miller20.29%12.86%
Al Viro10.15%12.86%
Ian Morris10.15%12.86%
Jan Engelhardt10.15%12.86%
Total684100.00%35100.00%
Directory: net/ipv6
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.