Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec
Steffen Klassert says: ==================== ipsec 2022-06-01 1) Revert "net: af_key: add check for pfkey_broadcast in function pfkey_process" From Michal Kubecek. 2) Don't set IPv4 DF bit when encapsulating IPv6 frames below 1280 bytes. From Maciej Żenczykowski. * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec: xfrm: do not set IPv4 DF flag when encapsulating IPv6 frames <= 1280 bytes. Revert "net: af_key: add check for pfkey_broadcast in function pfkey_process" ==================== Link: https://lore.kernel.org/r/20220601103349.2297361-1-steffen.klassert@secunet.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
2440d2068a
|
@ -2826,10 +2826,12 @@ static int pfkey_process(struct sock *sk, struct sk_buff *skb, const struct sadb
|
||||||
void *ext_hdrs[SADB_EXT_MAX];
|
void *ext_hdrs[SADB_EXT_MAX];
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = pfkey_broadcast(skb_clone(skb, GFP_KERNEL), GFP_KERNEL,
|
/* Non-zero return value of pfkey_broadcast() does not always signal
|
||||||
BROADCAST_PROMISC_ONLY, NULL, sock_net(sk));
|
* an error and even on an actual error we may still want to process
|
||||||
if (err)
|
* the message so rather ignore the return value.
|
||||||
return err;
|
*/
|
||||||
|
pfkey_broadcast(skb_clone(skb, GFP_KERNEL), GFP_KERNEL,
|
||||||
|
BROADCAST_PROMISC_ONLY, NULL, sock_net(sk));
|
||||||
|
|
||||||
memset(ext_hdrs, 0, sizeof(ext_hdrs));
|
memset(ext_hdrs, 0, sizeof(ext_hdrs));
|
||||||
err = parse_exthdrs(skb, hdr, ext_hdrs);
|
err = parse_exthdrs(skb, hdr, ext_hdrs);
|
||||||
|
|
|
@ -273,6 +273,7 @@ static int xfrm4_beet_encap_add(struct xfrm_state *x, struct sk_buff *skb)
|
||||||
*/
|
*/
|
||||||
static int xfrm4_tunnel_encap_add(struct xfrm_state *x, struct sk_buff *skb)
|
static int xfrm4_tunnel_encap_add(struct xfrm_state *x, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
|
bool small_ipv6 = (skb->protocol == htons(ETH_P_IPV6)) && (skb->len <= IPV6_MIN_MTU);
|
||||||
struct dst_entry *dst = skb_dst(skb);
|
struct dst_entry *dst = skb_dst(skb);
|
||||||
struct iphdr *top_iph;
|
struct iphdr *top_iph;
|
||||||
int flags;
|
int flags;
|
||||||
|
@ -303,7 +304,7 @@ static int xfrm4_tunnel_encap_add(struct xfrm_state *x, struct sk_buff *skb)
|
||||||
if (flags & XFRM_STATE_NOECN)
|
if (flags & XFRM_STATE_NOECN)
|
||||||
IP_ECN_clear(top_iph);
|
IP_ECN_clear(top_iph);
|
||||||
|
|
||||||
top_iph->frag_off = (flags & XFRM_STATE_NOPMTUDISC) ?
|
top_iph->frag_off = (flags & XFRM_STATE_NOPMTUDISC) || small_ipv6 ?
|
||||||
0 : (XFRM_MODE_SKB_CB(skb)->frag_off & htons(IP_DF));
|
0 : (XFRM_MODE_SKB_CB(skb)->frag_off & htons(IP_DF));
|
||||||
|
|
||||||
top_iph->ttl = ip4_dst_hoplimit(xfrm_dst_child(dst));
|
top_iph->ttl = ip4_dst_hoplimit(xfrm_dst_child(dst));
|
||||||
|
|
Loading…
Reference in New Issue