Revision af157fa3

View differences:

proto/ospf/iface.c
423 423
  ifa->strictnbma = ip->strictnbma;
424 424
  ifa->waitint = ip->waitint;
425 425
  ifa->dead = (ip->dead == 0) ? ip->deadc * ifa->helloint : ip->dead;
426
  ifa->stub = ip->stub;
426
  ifa->stub = ospf_iface_stubby(ip, addr);
427 427
  ifa->ioprob = OSPF_I_OK;
428 428
  ifa->rxbuf = ip->rxbuf;
429 429

  
proto/ospf/ospf.c
763 763
	}
764 764

  
765 765
	/* stub */
766
	if ((oldip->stub == 0) && (newip->stub != 0))
766
	int old_stub = ospf_iface_stubby(oldip, ifa->addr);
767
	int new_stub = ospf_iface_stubby(newip, ifa->addr);
768
	if (!old_stub && new_stub)
767 769
	{
768
	  ifa->stub = newip->stub;
770
	  ifa->stub = 1;
769 771
	  OSPF_TRACE(D_EVENTS, "Interface %s is now stub.", ifa->iface->name);
770 772
	}
771
	if ((oldip->stub != 0) && (newip->stub == 0) && (ifa->ioprob == OSPF_I_OK))
773
	if (old_stub && !new_stub && (ifa->ioprob == OSPF_I_OK))
772 774
	{
773
	  ifa->stub = newip->stub;
774
	  OSPF_TRACE(D_EVENTS,
775
		     "Interface %s is no longer stub.", ifa->iface->name);
775
	  ifa->stub = 0;
776
	  OSPF_TRACE(D_EVENTS, "Interface %s is no longer stub.", ifa->iface->name);
776 777
	}
777 778

  
778 779
#ifdef OSPFv2	
proto/ospf/ospf.h
772 772
#endif
773 773
};
774 774

  
775
#if defined(OSPFv2) && !defined(CONFIG_MC_PROPER_SRC)
776
static inline int
777
ospf_iface_stubby(struct ospf_iface_patt *ip, struct ifa *addr)
778
{
779
  /*
780
   * We cannot properly support multiple OSPF ifaces on real iface
781
   * with multiple prefixes, therefore we force OSPF ifaces with
782
   * non-primary IP prefixes to be stub.
783
   */
784
  return ip->stub || !(addr->flags & IA_PRIMARY);
785
}
786
#else
787
static inline int
788
ospf_iface_stubby(struct ospf_iface_patt *ip, struct ifa *addr UNUSED)
789
{
790
  return ip->stub;
791
}
792
#endif
793

  
775 794
int ospf_import_control(struct proto *p, rte **new, ea_list **attrs,
776 795
			struct linpool *pool);
777 796
struct ea_list *ospf_make_tmp_attrs(struct rte *rt, struct linpool *pool);
sysdep/cf/README
5 5
CONFIG_SELF_CONSCIOUS	We're able to recognize whether route was installed by us
6 6
CONFIG_MULTIPLE_TABLES	The kernel supports multiple routing tables
7 7
CONFIG_ALL_TABLES_AT_ONCE	Kernel scanner wants to process all tables at once
8
CONFIG_MC_PROPER_SRC	Multicast packets have source address according to socket saddr field
8 9

  
9 10
CONFIG_UNIX_IFACE	Use Unix interface scanner
10 11
CONFIG_UNIX_SET		Use Unix route setting
sysdep/cf/linux-22.h
10 10
#define CONFIG_SELF_CONSCIOUS
11 11
#define CONFIG_MULTIPLE_TABLES
12 12
#define CONFIG_ALL_TABLES_AT_ONCE
13
#define CONFIG_MC_PROPER_SRC
13 14

  
14 15
#undef CONFIG_SKIP_MC_BIND
15 16

  

Also available in: Unified diff