summaryrefslogtreecommitdiff
path: root/proto/bfd/packets.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto/bfd/packets.c')
-rw-r--r--proto/bfd/packets.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/proto/bfd/packets.c b/proto/bfd/packets.c
index aec91ca6..6097bcae 100644
--- a/proto/bfd/packets.c
+++ b/proto/bfd/packets.c
@@ -416,6 +416,8 @@ bfd_err_hook(sock *sk, int err)
sock *
bfd_open_rx_sk(struct bfd_proto *p, int multihop, int af)
{
+ struct bfd_config *cf = (struct bfd_config *) (p->p.cf);
+
sock *sk = sk_new(p->tpool);
sk->type = SK_UDP;
sk->subtype = af;
@@ -432,6 +434,9 @@ bfd_open_rx_sk(struct bfd_proto *p, int multihop, int af)
sk->priority = sk_priority_control;
sk->flags = SKF_THREAD | SKF_LADDR_RX | (!multihop ? SKF_TTL_RX : 0);
+ if (cf->zero_udp6_checksum_rx)
+ sk->flags |= SKF_UDP6_NO_CSUM_RX;
+
if (sk_open(sk) < 0)
goto err;
@@ -447,6 +452,8 @@ err:
sock *
bfd_open_rx_sk_bound(struct bfd_proto *p, ip_addr local, struct iface *ifa)
{
+ struct bfd_config *cf = (struct bfd_config *) (p->p.cf);
+
sock *sk = sk_new(p->tpool);
sk->type = SK_UDP;
sk->saddr = local;
@@ -464,6 +471,9 @@ bfd_open_rx_sk_bound(struct bfd_proto *p, ip_addr local, struct iface *ifa)
sk->priority = sk_priority_control;
sk->flags = SKF_THREAD | SKF_BIND | (ifa ? SKF_TTL_RX : 0);
+ if (cf->zero_udp6_checksum_rx)
+ sk->flags |= SKF_UDP6_NO_CSUM_RX;
+
if (sk_open(sk) < 0)
goto err;