On Sun, Sep 02, 2018 at 08:05:55AM +0200, Remi Locherer wrote:
> On Sat, Sep 01, 2018 at 10:38:09PM +0200, Sebastian Benoit wrote:
> > Remi Locherer([email protected]) on 2018.09.01 21:53:21 +0200:
> > > Hi,
> > > 
> > > Since slaacd is able to use pledge in the parent process I thought it may
> > > be possible for ospfd too.
> > > 
> > > It works fine until ospfd gets reloaded. At this point it uses setsockopt
> > > to set the priority filter on the routing socket.
> > > 
> > > Since I could not find a promise for this I extended wroute. Does this 
> > > make
> > > sense? Would another promise or something completely different be better?
> > 
> > just route would be good enough, because route is for receiving routes,
> > and the route filter just changes which routes you get.
> 
> ospfd is not happy with "pledge("stdio rpath sendfd route", NULL)"
> 
> During reload:
> 
> kr_reload: priority filter disabled
> orig_rtr_lsa: area 0.0.0.0
> Abort trap (core dumped) 
> orig_rtr_lsa: stub net, interface pair0
> orig_rtr_lsa: stub net, interface vether0
> [...]
> 
> ospfd[2432]: pledge "inet", syscall 105

Theo pointed out a ktrace is needed here to understand what is going on:

 18069 ospfd    GIO   fd 2 wrote 36 bytes
       "kr_reload: priority filter disabled
       "
 18069 ospfd    RET   write 36/0x24
 18069 ospfd    CALL  setsockopt(6,17<unknown>,3,0x7f7ffffefb70,4)
 18069 ospfd    PLDG  setsockopt, "inet", errno 1 Operation not permitted
 18069 ospfd    PSIG  SIGABRT SIG_DFL
 18069 ospfd    NAMI  "ospfd.core"


This is from the following line in  osfpd/kroute.c

if (setsockopt(kr_state.fd, AF_ROUTE, ROUTE_PRIOFILTER, &filter_prio,
            sizeof(filter_prio)) == -1) {

Reply via email to