/* * xfrm4_mode_transport.c - Transport mode encapsulation for IPv4. * * Copyright (c) 2004-2006 Herbert Xu */ #include #include #include #include #include #include #include #include /* Add encapsulation header. * * The IP header will be moved forward to make space for the encapsulation * header. */ static int xfrm4_transport_output(struct xfrm_state *x, struct sk_buff *skb) { struct iphdr *iph = ip_hdr(skb); int ihl = iph->ihl * 4; skb_set_network_header(skb, -x->props.header_len); skb->mac_header = skb->network_header + offsetof(struct iphdr, protocol); skb->transport_header = skb->network_header + ihl; __skb_pull(skb, ihl); memmove(skb_network_header(skb), iph, ihl); return 0; } /* Remove encapsulation header. * * The IP header will be moved over the top of the encapsulation header. * * On entry, skb->h shall point to where the IP header should be and skb->nh * shall be set to where the IP header currently is. skb->data shall point * to the start of the payload. */ static int xfrm4_transport_input(struct xfrm_state *x, struct sk_buff *skb) { int ihl = skb->data - skb_transport_header(skb); if (skb->transport_header != skb->network_header) { memmove(skb_transport_header(skb), skb_network_header(skb), ihl); skb->network_header = skb->transport_header; } ip_hdr(skb)->tot_len = htons(skb->len + ihl); skb_reset_transport_header(skb); return 0; } static struct xfrm_mode xfrm4_transport_mode = { .input = xfrm4_transport_input, .output = xfrm4_transport_output, .owner = THIS_MODULE, .encap = XFRM_MODE_TRANSPORT, }; static int __init xfrm4_transport_init(void) { return xfrm_register_mode(&xfrm4_transport_mode, AF_INET); } static void __exit xfrm4_transport_exit(void) { int err; err = xfrm_unregister_mode(&xfrm4_transport_mode, AF_INET); BUG_ON(err); } module_init(xfrm4_transport_init); module_exit(xfrm4_transport_exit); MODULE_LICENSE("GPL"); MODULE_ALIAS_XFRM_MODE(AF_INET, XFRM_MODE_TRANSPORT); /a>diff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2017-01-03 01:14:27 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-01-04 11:08:13 +0100
commitaebe55c2d4b998741c0847ace1b4af47d73c763b (patch)
tree247be137e8262c931d0c505deea4cea997ba6542 /net/ieee802154/Kconfig
parent0c744ea4f77d72b3dcebb7a8f2684633ec79be88 (diff)
drm: Clean up planes in atomic commit helper failure path
If waiting for fences fails for blocking commits, planes must be cleaned up before returning. Cc: stable@vger.kernel.org Fixes: f6ce410a59a4 ("drm/fence: allow fence waiting to be interrupted by userspace") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170102231427.7192-1-laurent.pinchart@ideasonboard.com
Diffstat (limited to 'net/ieee802154/Kconfig')