diff --git a/board/safety/safety_hyundai.h b/board/safety/safety_hyundai.h index 3e9d23216c..5881613480 100644 --- a/board/safety/safety_hyundai.h +++ b/board/safety/safety_hyundai.h @@ -250,8 +250,16 @@ static int hyundai_fwd_hook(int bus_num, int addr) { if (bus_num == 0) { bus_fwd = 2; } - if ((bus_num == 2) && (addr != 0x340) && (addr != 0x485)) { - bus_fwd = 0; + + if (bus_num == 2) { + bool is_lkas_11 = (addr == 0x340); + bool is_hda11_mfc = (addr == 0x484) && hyundai_camera_scc && !hyundai_longitudinal; + bool is_lfahda_mfc = (addr == 0x485); + + bool block_msg = is_lkas_11 || is_hda11_mfc || is_lfahda_mfc; + if (!block_msg) { + bus_fwd = 0; + } } return bus_fwd; @@ -275,6 +283,7 @@ static safety_config hyundai_init(uint16_t param) { static const CanMsg HYUNDAI_CAMERA_SCC_TX_MSGS[] = { {0x340, 0, 8}, // LKAS11 Bus 0 {0x4F1, 2, 4}, // CLU11 Bus 2 + {0x484, 0, 8}, // HDA11_MFC Bus 0 {0x485, 0, 4}, // LFAHDA_MFC Bus 0 }; diff --git a/tests/safety/test_hyundai.py b/tests/safety/test_hyundai.py index 1bff99fa75..20b38e0ace 100755 --- a/tests/safety/test_hyundai.py +++ b/tests/safety/test_hyundai.py @@ -129,6 +129,9 @@ class TestHyundaiSafetyCameraSCC(TestHyundaiSafety): BUTTONS_TX_BUS = 2 # tx on 2, rx on 0 SCC_BUS = 2 # rx on 2 + TX_MSGS = [[0x340, 0], [0x4F1, 0], [0x484, 0], [0x485, 0]] + FWD_BLACKLISTED_ADDRS = {2: [0x340, 0x484, 0x485]} + def setUp(self): self.packer = CANPackerPanda("hyundai_kia_generic") self.safety = libpanda_py.libpanda