Browse Source

[991] Conditional assignment replaced with if else clause.

This overcomes the build failure on Solaris where it complains about
incompatible types of ? operands.
Marcin Siodelski 12 years ago
parent
commit
378613249f
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/lib/dhcp/pkt_filter_inet.cc

+ 5 - 1
src/lib/dhcp/pkt_filter_inet.cc

@@ -54,7 +54,11 @@ int PktFilterInet::openSocket(const Iface&,
 
     // If we are to receive broadcast messages we have to bind
     // to "ANY" address.
-    addr4.sin_addr.s_addr = receive_bcast ? INADDR_ANY : htonl(addr);
+    if (receive_bcast) {
+        addr4.sin_addr.s_addr = INADDR_ANY;
+    } else {
+        addr4.sin_addr.s_addr = htonl(addr);
+    }
 
     int sock = socket(AF_INET, SOCK_DGRAM, 0);
     if (sock < 0) {