-
- EthernetSourceBuilder ethSourBuild = new EthernetSourceBuilder()
- .setAddress(ethernetSourceAddress(sourceMatch));
- targetEthMatchBuild.setEthernetSource(ethSourBuild.build());
-
- EthernetDestinationBuilder ethDestBuild = new EthernetDestinationBuilder()
- .setAddress(ethernetDestAddress(sourceMatch));
- targetEthMatchBuild.setEthernetDestination(ethDestBuild.build());
+ if(sourceMatch.getField(DL_SRC) != null && sourceMatch.getField(DL_SRC).getValue() != null) {
+ EthernetSourceBuilder ethSourBuild = new EthernetSourceBuilder()
+ .setAddress(ethernetSourceAddress(sourceMatch));
+ targetEthMatchBuild.setEthernetSource(ethSourBuild.build());
+ }
+ if(sourceMatch.getField(DL_DST) != null && sourceMatch.getField(DL_DST).getValue() != null) {
+ EthernetDestinationBuilder ethDestBuild = new EthernetDestinationBuilder()
+ .setAddress(ethernetDestAddress(sourceMatch));
+ targetEthMatchBuild.setEthernetDestination(ethDestBuild.build());
+ }