meta-google: gbmc-ncsi-config: Only impersonate host under NCSI

This adds a flag to the interface based on the presence of the NCSI
state machine. Non-NCSI connections will not impersonate the CN to avoid
breaking flat network topologies where the BMC and CN share an ethernet
channel.

Tested: On a machine without an NCSI stack to verify the impersonation
record is not present. Also on a machine with NCSI to prove that
impersonation is still working.

Change-Id: Ifb8048abe443c60a333e7eff7cdc9d063a8c656a
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-alias.service.in b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-alias.service.in
new file mode 100644
index 0000000..93ad535
--- /dev/null
+++ b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-alias.service.in
@@ -0,0 +1,12 @@
+[Unit]
+BindsTo=ncsid@@NCSI_IF@.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/ip link set @NCSI_IF@ alias ncsi
+ExecStop=/usr/bin/ip link set @NCSI_IF@ alias ''
+
+[Install]
+WantedBy=nic-hostful@@NCSI_IF@.target
+WantedBy=nic-hostless@@NCSI_IF@.target