From 3b835e81bfe2af65268033a4e75692afd8f19350 Mon Sep 17 00:00:00 2001 From: job Date: Wed, 15 May 2024 08:45:03 +0000 Subject: [PATCH] Mark network control packets with DSCP CS6 (parity with ospfd) OK claudio@ --- usr.sbin/ospf6d/ospfe.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.sbin/ospf6d/ospfe.c b/usr.sbin/ospf6d/ospfe.c index a2a161a9889..0627ca71116 100644 --- a/usr.sbin/ospf6d/ospfe.c +++ b/usr.sbin/ospf6d/ospfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.c,v 1.71 2023/12/13 15:34:43 claudio Exp $ */ +/* $OpenBSD: ospfe.c,v 1.72 2024/05/15 08:45:03 job Exp $ */ /* * Copyright (c) 2005 Claudio Jeker @@ -75,6 +75,7 @@ ospfe(struct ospfd_conf *xconf, int pipe_parent2ospfe[2], int pipe_ospfe2rde[2], struct passwd *pw; struct event ev_sigint, ev_sigterm; pid_t pid; + int pre = IPTOS_PREC_INTERNETCONTROL; switch (pid = fork()) { case -1: @@ -90,6 +91,10 @@ ospfe(struct ospfd_conf *xconf, int pipe_parent2ospfe[2], int pipe_ospfe2rde[2], SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK, IPPROTO_OSPF)) == -1) fatal("error creating raw socket"); + if (setsockopt(xconf->ospf_socket, IPPROTO_IPV6, IPV6_TCLASS, &pre, + sizeof(pre)) == -1) + fatal("setsockopt IPV6_TCLASS"); + /* set some defaults */ if (if_set_mcast_loop(xconf->ospf_socket) == -1) fatal("if_set_mcast_loop"); -- 2.20.1