diff options
Diffstat (limited to 'sys/netinet/libalias/alias_db.c')
-rw-r--r-- | sys/netinet/libalias/alias_db.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index 9f8c6064d2a7..5b53067705bf 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -2048,9 +2048,15 @@ LibAliasSetAliasPortRange(struct libalias *la, u_short port_low, u_short port_high) { LIBALIAS_LOCK(la); - la->aliasPortLower = port_low; - /* Add 1 to the aliasPortLength as modulo has range of 1 to n-1 */ - la->aliasPortLength = port_high - port_low + 1; + if (port_low) { + la->aliasPortLower = port_low; + /* Add 1 to the aliasPortLength as modulo has range of 1 to n-1 */ + la->aliasPortLength = port_high - port_low + 1; + } else { + /* Set default values */ + la->aliasPortLower = 0x8000; + la->aliasPortLength = 0x8000; + } LIBALIAS_UNLOCK(la); } |