From 1423c809cc4ddc2e013ba6264c49a11e5719c6f2 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 14 Aug 2008 17:59:25 +0100 Subject: [lib] mes_lookup string lookup table argument should be marked const 2008-08-14 Stephen Hemminger * lib/log.{c,h}: struct message argument should point to const * */*.c: adjust to suit, Signed-off-by: Paul Jakma --- lib/sockopt.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/sockopt.c') diff --git a/lib/sockopt.c b/lib/sockopt.c index a2038a5c..2f01199a 100644 --- a/lib/sockopt.c +++ b/lib/sockopt.c @@ -342,6 +342,19 @@ setsockopt_ipv4_ifindex (int sock, int val) return ret; } +int +setsockopt_ipv4_tos(int sock, int tos) +{ + int ret; + + ret = setsockopt (sock, IPPROTO_IP, IP_TOS, &tos, sizeof (tos)); + if (ret < 0) + zlog_warn ("Can't set IP_TOS option for fd %d to %#x: %s", + sock, tos, safe_strerror(errno)); + return ret; +} + + int setsockopt_ifindex (int af, int sock, int val) { -- cgit v1.2.1